package com.kingyun.gpsinspection.purificationservice.facade.service.iam.adm;

import com.alibaba.fastjson.JSONObject;
import com.kingyun.gpsinspection.purificationservice.facade.model.BootstrapSearchBean;
import com.kingyun.gpsinspection.purificationservice.facade.model.iam.adm.TrainingPeople;

import java.util.List;

/**
 * 培训人员服务层
 * created by lutinabo 2016/12/9
 */
public interface TrainingPeopleService {

    /**
     * 查询列表
     * @param bootstrapSearchBean
     * @return
     */
    JSONObject list(BootstrapSearchBean bootstrapSearchBean);

    /**
     * 删除培训人员
     * @param trainingPeopleId
     * @return
     */
    int deleteByPrimaryKey(String[] trainingPeopleId);

    /**
     * 新增培训人员
     * @param record
     * @return
     */
    int insertSelective(TrainingPeople record);

    /**
     * 根据id查询培训人员
     * @param trainingPeopleId
     * @return
     */
    TrainingPeople selectByPrimaryKey(String trainingPeopleId);

    /**
     * 更新培训人员
     * @param record
     * @return
     */
    int updateByPrimaryKeySelective(TrainingPeople record);

    /**
     * 查看该人员是否已在该培训中
     * @param id 人员id
     * @param trainingId 计划id
     * @return
     */
    boolean isExistById(String id, String trainingId);

    /**
     * 根据培训计划删除数据
     * @param trainingPlanIds
     * @return
     */
    int deleteByTrainingPlanIds(String[] trainingPlanIds);

    /**
     * 根据培训计划id查询人员
     * @param trainingId 培训计划id
     * @return
     */
    List<TrainingPeople> queryPeoPleByTrainingId(String trainingId);

    /**
     * 批量删除(不在传入的返回值内的)
     * @param oldExitPeople
     * @return
     */
    int batchDel(List<TrainingPeople> oldExitPeople);

    /**
     * 根据培训计划删除所关联人员
     * @param trainingId
     * @return
     */
    int  delByTrainPlanId(String trainingId);
}
